<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    /*
    # 5、小明家里有三个人，爸爸和妈妈，小明是男的，今年18岁，兴趣爱好是打篮球和读书，
    爸爸是软件程序员，妈妈是UI设计师，小明家在深圳南山有一套100平方的房子，户型是三房一厅，
    今年小明家刚买了一辆特斯拉Model3.

    使用 **对象字面量**、**new Object** 、**构造函数** 三种方式创建以上对象
    */
    let xiaoming=new Object();
    xiaoming.sex="男";
    xiaoming.age=18;
    xiaoming.hobby="打篮球和读书";
    let xiaoming1={
        sex:"男",
        age:18,
        hobby:"打篮球读书"
    }
    function Proper(zhiye,age,hobby){
        this.sex="男";
        this.age=18;
        this.hobby="打篮球还有读书";
    }
    var xiaoming2=new Proper();
    let baba=new Object();
    baba.zhiye="软件程序员";
    baba.age=41;
    let baba1={
        zhiye:"软件程序员",
        age:41
    }
    function Proper1(zhiye,age){
        this.zhiye="软件程序员";
        this.age=42;
    }
    var baba2=new Proper();
    let mom=new Object();
    mom.zhiye="UI设计师";
    mom.age=37;
    let mom1={
        zhiye:"UI设计师",
        age:41
    }
    function Proper2(zhiye,age,hobby){
        this.zhiye="UI设计师";
        this.age=38;
        this.hobby="音乐";
    }
    var mom2=new Proper();
    let fangzi={
        weizhi:"深圳南山",
        daxiao:"100平方",
        huxing:"三室一厅"
    }
    function Pro(money,lexing){
        this.money=money;
        this.lexing=lexing;
    }
    var car=new Pro("3000000CNY","特拉斯Model3")
    for(let key in xiaoming){
        console.log(key,':',xiaoming[key]);
        
    }
    for(let key in baba){
        console.log(key,':',baba[key]);
        
    }
    for(let key in mom){
        console.log(key,':',mom[key]);
        
    }
    for(let key in xiaoming1){
        console.log(key,':',xiaoming1[key]);
        
    }
    for(let key in baba1){
        console.log(key,':',baba1[key]);
        
    }
    for(let key in mom1){
        console.log(key,':',mom1[key]);
        
    }
    for(let key in xiaoming2){
        console.log(key,':',xiaoming2[key]);
        
    }
    for(let key in baba2){
        console.log(key,':',baba2[key]);
        
    }
    for(let key in mom2){
        console.log(key,':',mom2[key]);
        
    }
    for(let key in fangzi){
        console.log(key,':',fangzi[key]);
        
    }
    for(let key in car){
        console.log(key,':',car[key]);
        
    }

</script>
</html>